package me.huqiao.loganlyzer.console;

public class TotalMessage {
    //标题
    private String headMsg="-";
    //总请求量
    private String allRequestCount="-";
    //独立访客
    private String singleRequestCount="-";
    //请求文件数
    private String requestFileCount="-";
    //来源地址
    private String requestAddressCount="-";

    //有效请求
    private String availableRequestCount="-";
    //分析耗时
    private String analysisTime="-";
    //静态文件
    private String staticFileCount="-";
    //日志大小
    private String logSize="-";

    //200请求
    private String request200Count="-";
    //404请求
    private String request404Count="-";
    //500请求
    private String request500Count="-";
    //请求总数
    private String requestTotalCount="-";


    /**
     * 概览-所有已分析的请求（2024/01/01/-2024/01/01/）
     * 所有请求    独立访客      请求文件 来源地址
     * 有效的请求  日志解析耗时   静态文件  日志大小
     * 失败的请求  过滤来自此IP的请求 未找到（404） 数据传输
     * 日志文件夹地址
     */
 public  void print(){
        System.out.println(ConsoleColor.getWhiteBg("概览-所有已分析的请求（"+headMsg+"）",-1));

        System.out.println(ConsoleColor.getWhiteBoard("所有请求",7)+ConsoleColor.getBlue(allRequestCount,4)+
                           ConsoleColor.getWhiteBoard("独立访客",8)+ConsoleColor.getBlue(singleRequestCount,4)+
                           ConsoleColor.getWhiteBoard("请求文件",6)+ConsoleColor.getBlue(requestFileCount,4)+
                           ConsoleColor.getWhiteBoard("来源地址",6)+ConsoleColor.getBlue(requestAddressCount,4));

        System.out.println(ConsoleColor.getWhiteBoard("有效的请求",6)+ConsoleColor.getBlue(availableRequestCount,4)+
                           ConsoleColor.getWhiteBoard("日志解析耗时",7)+ConsoleColor.getBlue(analysisTime,4)+
                           ConsoleColor.getWhiteBoard("静态文件",6)+ConsoleColor.getBlue(staticFileCount,4)+
                           ConsoleColor.getWhiteBoard("日志大小",6)+ConsoleColor.getBlue(logSize,4));

        System.out.println(ConsoleColor.getWhiteBoard("200请求",8)+ConsoleColor.getBlue(request200Count,4)+
                           ConsoleColor.getWhiteBoard("404请求",9)+ConsoleColor.getBlue(request404Count,4)+
                           ConsoleColor.getWhiteBoard("500请求",7)+ConsoleColor.getBlue(request500Count,4)+
                           ConsoleColor.getWhiteBoard("总请求数",6)+ConsoleColor.getBlue(requestTotalCount,4));

//        System.out.println(WHITE+"有效的请求 "+ RESET+BLUE+20+ RESET+WHITE+"日志解析耗时 "+ RESET+BLUE+20+ RESET+WHITE+" 静态文件 "+ RESET+BLUE+20+ RESET+WHITE+" 日志大小"+ RESET+BLUE+20+ RESET);
//        System.out.println(WHITE+"200请求 "+ RESET+BLUE+20+ RESET+WHITE+"404请求 "+ RESET+BLUE+20+ RESET+WHITE+" 500请求 "+ RESET+BLUE+20+ RESET+WHITE+" 总请求数"+ RESET+BLUE+20+ RESET);
// ANSI escape code constants for text colors

    // Print colored text to the console
        System.out.println(ConsoleColor.GREEN + "This text is green." + ConsoleColor.RESET);
        System.out.println(ConsoleColor.YELLOW + "This text is yellow." + ConsoleColor.RESET);
        System.out.println(ConsoleColor.RED + "This text is red." + ConsoleColor.RESET);

    // ANSI escape code constants for text colors and background colors


    // Print colored text with the background to the console
        System.out.println(ConsoleColor.RED_TEXT + ConsoleColor.BLACK_BG + "This text is red with black background." + ConsoleColor.RESET);
        System.out.println(ConsoleColor.GREEN_TEXT + ConsoleColor.WHITE_BG + "This text is green with white background." + ConsoleColor.RESET);
        System.out.println(ConsoleColor.YELLOW_TEXT + ConsoleColor.BLACK_BG + "This text is yellow with black background." + ConsoleColor.RESET);
}


}
